package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wx.WxCommentListVO;
import com.cskaoyan.service.wx.WxCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wx/comment/")
public class WxCommentController {

    @Autowired
    WxCommentService wxCommentService;

    @RequestMapping("list")
    public BaseRespVo wxCommentList(Integer valueId, Byte type,
                                    Integer size, Integer page,
                                    Integer showType){
        WxCommentListVO wxCommentListVO = wxCommentService.queryWxCommentList(valueId,type,size,page,showType);
        return BaseRespVo.ok(wxCommentListVO);
    }

    @RequestMapping("count")
    public BaseRespVo wxCommentCount(Integer valueId, Byte type){
        Map<String,Integer> map = wxCommentService.queryWxCommentCount(valueId, type);
        return BaseRespVo.ok(map);
    }

}
